<template>
	<div v-if="data" style="margin-bottom: 30px;">
		我要预约<span>   </span> <el-button v-if="data[0].type!=0" size="mini" type="danger" @click="kaiguan(1,0)">关闭</el-button>
	            <el-button size="mini" v-if="data[0].type==0"  type="primary" @click="kaiguan(1,1)">开启</el-button>
	</div>
	<div  v-if="data">
		互动问答<span>   </span> <el-button v-if="data[1].type!=0"  size="mini" type="danger" @click="kaiguan(2,0)">关闭</el-button>
	            <el-button size="mini" v-if="data[1].type==0" type="primary" @click="kaiguan(2,1)">开启</el-button>
	</div>

</template>

<script lang="ts">
	var datas;
	import {
		ElMessageBox,
		ElMessage
	} from 'element-plus'
	export default {
		data() {
			return {
				data:""
			}
		},
		
		mounted() {
			this.getData();
		},
		methods: {
			
			kaiguan(i,is){
				this.$http.post("/index.php/index/Userinfo/indexset",{id:i,type:is,tokenid:'nf2021113012336899abc'}).then(data => {
					
					this.getData();
					
				})
			},
			getData() {
				
				this.$http.post("/index.php/index/Userinfo/indexsetlist",{tokenid:'nf2021113012336899abc'}).then(data => {   
					console.log(data)
					 this.data = data;
					
				})
			},

			handleAvatarSuccess(file) {

				this.form.image = file.data;
			},



		}
	}
</script>
